﻿using SRM.Application.PageResult.Dtos;
using SRM.Application.PageResult.IServices;
using SRM.Core.Models;
using SRM.Core.Models.Base;
using SRM.Core.Repositories;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SRM.Application.PageResult.ReturnOrderPage
{
    public class ReturnOrderDtlServer : IReturnOrderDtlServer
    {
        private readonly IRepository<ReturnOrderDetail> _returnOrderDtlRepository;

        public ReturnOrderDtlServer(IRepository<ReturnOrderDetail> returnOrderDtlRepository)
        {
            _returnOrderDtlRepository = returnOrderDtlRepository;
        }

        public async  Task<PagerModel<ReturnOrderDetail>> GetReturnOrderDtl(PagerModelInput input)
        {
            var query = await _returnOrderDtlRepository.GetAllListAsync();
            PagerModel<ReturnOrderDetail> pagerModel = PagedList<ReturnOrderDetail>.PageList(input, query);
            return pagerModel;
        }
    }
}
